const mongoose = require("./db")
const conn = mongoose.connection
conn.on("error", () => console.log("连接数据库失败"))

// 模型对象
const UserSchema  = mongoose.Schema({
  id: { type: String },
  userName: { type: String }, //昵称
  sex: { type: String }, //性别
  phone: { type: String }, //手机号
  password: { type: String }, //密码
  userImg: { type: String }, // 头像
  addTime: { type: String }, //创建时间
  flag: {type: Number}, //标志账号是否可用
  explain: { type: String } //封禁说明
});

const user = mongoose.model("mobileUsers", UserSchema )
module.exports = user